
CC = gcc

FLAGS = -Wall
SDL = -lSDL -lSDL_image
OPENGL = -lGLU -lGLU -lm -lX11

INC = -Iheader/ -Isource/ -I./

OBJECTS = init.o lightSource.o point.o vector.o texture.o object.o glm.o #glmimg.o
BUILD_OBJECTS = $(OBJECTS:%=build/%)

.PHONY: clean all

all: $(BUILD_OBJECTS) bgod

bgod: main.cpp
	$(CC) -o $@ $^ $(BUILD_OBJECTS) $(FLAGS) $(SDL) $(OPENGL) $(INC)

#init.o: init.cpp init.h
#	$(CC) -c -o $@ $< $(FLAGS) $(SDL) $(INC)

#meshObject.o: objreader/meshObject.cpp objreader/meshObject.h
#	$(CC) -c -o $@ $< $(FLAGS) $(INC)

build/%.o: source/%.cpp header/%.h
	$(CC) -c -o $@ $< $(FLAGS) $(INC)

build/%.o: glm/%.cpp glm/%.h
	$(CC) -c -o $@ $< $(FLAGS) $(INC)

clean:
	rm build/*

